#ifndef __FORWARD_EVENT_H_INCLUDED__
#define __FORWARD_EVENT_H_INCLUDED__

//#include "forward_session.h"

class forward_session;

#ifdef __cplusplus
extern "C" {
#endif

/**
 * 自定义事件结构
 * role为LISTENER时union使用fd，其余使用ptr_session
 *
 */
class forward_event{

public:

    enum FORWARD_ROLE{
    	IDLE_ROLE,
        IN,
        OUT,
        LISTENER,
        MAX_ROLE
    };

    enum FORWARD_PROTOCOL{
    	IDLE_PROTOCOL,
    	TCP,
    	UDP,
    	MAX_PROTOCOL
    };

    forward_event();

    ~forward_event();

	void reset();

    union{
        forward_session* ptr_session;
        int fd;
    };

    FORWARD_ROLE role;

    FORWARD_PROTOCOL protocol;
};

#ifdef __cplusplus
}
#endif

#endif // __FORWARD_EVENT_H_INCLUDED__
